home *** CD-ROM | disk | FTP | other *** search
Makefile | 1991-11-09 | 6.4 KB | 188 lines |
- # Hacked up Makefile for bash on the ST under MiNT
-
- BISON=bison -y
- CC=gcc -traditional
-
- MACHINE="Atari"
- OS=MiNT
-
- # This system has some peculiar flags that must be passed to the
- # the C compiler (or to cpp).
- SYSDEP=-O -fomit-frame-pointer -fcombine-regs
-
- # This system has the vprintf () and vfprintf () calls.
- # Well, yes, but most Eunuchs systems use varargs (which is braindead)
- #VPRINTF=-DHAVE_VPRINTF
- # This system has <unistd.h>.
- UNISTD=-DHAVE_UNISTD_H
- # This system has <sys/resource.h>
- RESOURCE=-DHAVE_RESOURCE
- # This systems signal () call returns a pointer to a function returning
- # void. The signal handlers themselves are thus void functions.
- SIGHANDLER=-DVOID_SIGHANDLER
- # This system has the strerror () function.
- STRERROR=-DHAVE_STRERROR
- # This system has <sys/wait.h>
- WAITH=-DHAVE_WAIT_H
- # This system has the getwd () call.
- GETWD=-DHAVE_GETWD
- # This system has a working version of dup2 ().
- DUP2=-DHAVE_DUP2
-
- SYSTEM_FLAGS=$(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
- $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) $(STRERROR) \
- -D$(MACHINE) -D$(OS)
- LDFLAGS=-s
- CFLAGS=$(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS)
- LDLIBS=-lreadline -lglob -ltermcap -liio
- CPPFLAGS=
-
- # These are required for sending bug reports.
- SYSTEM_NAME = $(MACHINE)
- OS_NAME = $(OS)
-
- # The name of this program.
- PROGRAM = bash
-
- # The type of machine Bash is being compiled on.
- HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)'
-
- # The default primary and secondary prompts.
- PPROMPT = '"\\u@\\h\\$$ "'
- SPROMPT = '"> "'
-
- bash_maintainer =dpg@Cs.Nott.AC.UK
- MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
-
- # The group of configuration flags. These are for shell.c
- CFG_FLAGS = -DPPROMPT=$(PPROMPT) -DSPROMPT=$(SPROMPT) -DOS_NAME='"$(OS_NAME)"' -DSYSTEM_NAME='$(SYSTEM_NAME)' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
-
- ALLOCA_DEFINE = -DHAVE_ALLOCA
- ALLOCA_CFLAGS = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
-
- RANLIB = echo
-
- BUILTINS_LIB = builtins/builtins.a
-
- OBJECTS=shell.o y.tab.o general.o make_cmd.o print_cmd.o $(GLOBO) \
- dispose_cmd.o execute_cmd.o variables.o copy_cmd.o \
- expr.o flags.o jobs.o subst.o hash.o mailcheck.o test.o \
- trap.o alias.o $(MALLOC) $(ALLOCA) braces.o unwind_prot.o \
- $(SIGLIST) version.o bashline.o $(BUILTINS_LIB)
-
- # Where the source code of the shell builtins resides.
- DEFDIR = builtins/
- BUILTIN_DEFS = $(DEFDIR)alias.def $(DEFDIR)bind.def $(DEFDIR)break.def \
- $(DEFDIR)builtin.def $(DEFDIR)cd.def $(DEFDIR)colon.def \
- $(DEFDIR)command.def $(DEFDIR)declare.def \
- $(DEFDIR)echo.def $(DEFDIR)enable.def $(DEFDIR)eval.def \
- $(DEFDIR)exec.def $(DEFDIR)exit.def $(DEFDIR)fc.def \
- $(DEFDIR)fg_bg.def $(DEFDIR)hash.def $(DEFDIR)help.def \
- $(DEFDIR)history.def $(DEFDIR)jobs.def $(DEFDIR)kill.def \
- $(DEFDIR)let.def $(DEFDIR)read.def $(DEFDIR)return.def \
- $(DEFDIR)set.def $(DEFDIR)setattr.def $(DEFDIR)shift.def \
- $(DEFDIR)source.def $(DEFDIR)suspend.def $(DEFDIR)test.def \
- $(DEFDIR)times.def $(DEFDIR)trap.def $(DEFDIR)type.def \
- $(DEFDIR)ulimit.def $(DEFDIR)umask.def $(DEFDIR)wait.def \
- $(DEFDIR)getopts.def $(DEFDIR)reserved.def
- BUILTIN_C_CODE = $(DEFDIR)mkbuiltins.c $(DEFDIR)common.c \
- $(DEFDIR)hashcom.h $(GETOPT_SOURCE)
- GETOPT_SOURCE = $(DEFDIR)getopt.c $(DEFDIR)getopt.h
- PSIZE_SOURCE = $(DEFDIR)psize.sh $(DEFDIR)psize.c
-
- all: $(PROGRAM)
-
- $(PROGRAM): .build $(OBJECTS) $(LIBDEP) .distribution
- $(RM) $@
- $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDLIBS)
- chmod +x $(PROGRAM)
-
- .build: newversion.aux
- if ./newversion.aux -build; then mv -f newversion.h version.h; fi
- @echo
- @echo " ***************************************************"
- @echo " * *"
- @echo " * Making Bash-`cat .distribution` for a $(MACHINE) running $(OS)."
- @echo " * *"
- @echo " ***************************************************"
- @echo
- @echo "$(PROGRAM) last made for a $(MACHINE) running $(OS)" >.machine
-
- version.h: newversion.aux
- if ./newversion.aux -build; then mv -f newversion.h version.h; fi
-
- y.tab.c: parse.y shell.h
- -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
- $(BISON) -d parse.y
- -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
-
- version.o: version.h version.c
-
- shell.o: shell.h flags.h shell.c posixstat.h filecntl.h endian.h
- $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
-
- endian.h: endian.aux
- ./endian.aux endian.h
-
- endian.aux: endian.c
- $(CC) $(CFLAGS) -o $@ endian.c
- chmod +x endian.aux
-
- variables.o: shell.h hash.h flags.h variables.h variables.c
- $(CC) -c $(CFLAGS) $(CPPFLAGS) $(HOSTTYPE_DECL) variables.c
-
- builtins/libbuiltins.a: $(BUILTIN_DEFS) $(BUILTIN_C_CODE)
- build_builtins_in_dir ($(DEFDIR))
-
- shell.h: general.h variables.h config.h quit.h
- jobs.h: endian.h quit.h
- variables.h: hash.h
- braces.o: general.h
- copy_cmd.o: shell.h hash.h
- copy_cmd.o: general.h variables.h config.h quit.h
- dispose_cmd.o: shell.h
- dispose_cmd.o: general.h variables.h config.h quit.h
- execute_cmd.o: shell.h y.tab.h posixstat.h flags.h jobs.h
- execute_cmd.o: general.h variables.h config.h quit.h hash.h endian.h
- execute_cmd.o: unwind_prot.h
- expr.o: shell.h hash.h
- expr.o: general.h variables.h config.h quit.h
- flags.o: flags.h config.h general.h quit.h
- general.o: shell.h maxpath.h
- general.o: general.h variables.h config.h quit.h
- hash.o: shell.h hash.h
- hash.o: general.h variables.h config.h quit.h
- jobs.o: shell.h hash.h trap.h jobs.h
- jobs.o: general.h variables.h config.h endian.h quit.h
- mailcheck.o: posixstat.h maxpath.h variables.h
- mailcheck.o: hash.h quit.h
- make_cmd.o: shell.h flags.h
- make_cmd.o: general.h variables.h config.h quit.h
- y.tab.o: shell.h flags.h maxpath.h
- y.tab.o: general.h variables.h config.h quit.h
- print_cmd.o: shell.h y.tab.h
- print_cmd.o: general.h variables.h config.h quit.h
- shell.o: shell.h flags.h
- shell.o: general.h variables.h config.h quit.h
- subst.o: shell.h flags.h alias.h jobs.h
- subst.o: general.h variables.h config.h endian.h quit.h
- test.o: posixstat.h
- trap.o: trap.h shell.h hash.h unwind_prot.h
- trap.o: general.h variables.h config.h quit.h
- unwind_prot.o: config.h general.h unwind_prot.h
- bashline.o: shell.h hash.h builtins.h
- bashline.o: general.h variables.h config.h quit.h alias.h
-
- .distribution:
- ./newversion.aux -dist `$(PROGRAM) -c 'echo $$BASH_VERSION'`
-
- newversion.aux: newversion.c
- $(CC) $(CFLAGS) $(CPPFLAGS) -o newversion.aux newversion.c
- chmod +x newversion.aux
-
- newversion: newversion.aux
- $(RM) .build
- ./newversion.aux -dist
- mv -f newversion.h version.h
- $(MAKE) $(MFLAGS)
-